class ModelQuestion:
    def __init__(self, id=None, question=None, answer=None):
        self.id = id
        self.question = question
        self.answer = answer

    def to_dict(self):
        return {
            "id": self.id,
            "question": self.question,
            "answer": self.answer
        }

    @classmethod
    def from_dict(cls, data):
        entity = cls()
        entity.id = data.get('id')
        entity.question = data.get('question')
        entity.answer = data.get('answer')
        return entity